package com.sgb.kjwl.view.ui.adapter.enterprise;

import android.content.Context;
import android.util.Log;
import android.view.View;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.ItemMakeoverDetailFlowBinding;
import com.sgb.kjwl.databinding.ItemMakeoverDetailQuestionBinding;
import com.sgb.kjwl.interfaces.RecyclerClick;
import com.sgb.kjwl.model.entity.enterprise.QuestionEnyiy;
import com.sgb.kjwl.model.entity.enterprise.TransferProcessEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class MakeOverDetailFlowAdapter extends BaseRecycleAdapter<TransferProcessEntity> {

    RecyclerClick<TransferProcessEntity> mRecyclerClick;

    public void setmRecyclerClick(RecyclerClick<TransferProcessEntity> mRecyclerClick) {
        this.mRecyclerClick = mRecyclerClick;
    }

    public MakeOverDetailFlowAdapter(Context context, List<TransferProcessEntity> datas) {
        super(context, R.layout.item_makeover_detail_flow, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, TransferProcessEntity ipPickSelectEntity) {
        holder.setBinding(BR.flow, ipPickSelectEntity);

        ItemMakeoverDetailFlowBinding itemMakeoverDetailFlowBinding = (ItemMakeoverDetailFlowBinding) holder.getmBinding();
        itemMakeoverDetailFlowBinding.tvItemMakeoverDetailFlow.setText(holder.getIndex_position()+1+"");
        if (holder.getIndex_position() == datas.size()-1){
            itemMakeoverDetailFlowBinding.ivItemMakeoverDetailFlowLine.setVisibility(View.GONE);
            itemMakeoverDetailFlowBinding.tvItemMakeoverDetailFlowPlace.setVisibility(View.GONE);
        }else {
            itemMakeoverDetailFlowBinding.ivItemMakeoverDetailFlowLine.setVisibility(View.VISIBLE);
            itemMakeoverDetailFlowBinding.tvItemMakeoverDetailFlowPlace.setVisibility(View.VISIBLE);
        }
    }
}
